﻿<Page
    x:Class="PuzzleModern.Phone.SettingsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:PuzzleModern"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Page.Resources>
        <DataTemplate x:Name="LabelTemplate">
            <TextBlock Text="{Binding}" TextWrapping="Wrap"/>
        </DataTemplate>
    </Page.Resources>
    
    <Grid x:Name="LayoutRoot">

        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Title Panel -->
        <StackPanel Grid.Row="0" Margin="19,0,0,0">
            <TextBlock Text="PORTABLE PUZZLE COLLECTION" Style="{ThemeResource TitleTextBlockStyle}" Margin="0,12,0,0"/>
            <TextBlock Text="settings" Margin="0,-6.5,0,26.5" Style="{ThemeResource HeaderTextBlockStyle}" CharacterSpacing="{ThemeResource PivotHeaderItemCharacterSpacing}"/>
        </StackPanel>

        <Grid Grid.Row="1" x:Name="ContentRoot" Margin="19,9.5,19,0">
            <StackPanel>
                <ToggleSwitch HeaderTemplate="{StaticResource LabelTemplate}" 
                              x:Name="GridViewSwitch"
                              Toggled="GridViewSwitch_Toggled"
                              IsOn="False" Margin="0,0,0,10">
                    Small buttons on launcher
                </ToggleSwitch>
                <ToggleSwitch HeaderTemplate="{StaticResource LabelTemplate}" 
                              x:Name="NewGameSwitch"
                              Toggled="NewGameSwitch_Toggled"
                              IsOn="True" Margin="0,0,0,10">
                    Show prompt on completing game
                </ToggleSwitch>
                <ToggleSwitch HeaderTemplate="{StaticResource LabelTemplate}" 
                              x:Name="ColorblindSwitch"
                              Toggled="ColorblindSwitch_Toggled">
                    Colorblind Mode (supported puzzles only)
                </ToggleSwitch>

                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="128" />
                    </Grid.ColumnDefinitions>
                    
                    <ComboBox Grid.Column="0" x:Name="MapPaletteBox" HeaderTemplate="{StaticResource LabelTemplate}" SelectionChanged="MapPaletteBox_SelectionChanged" Header="Map - Color palette" SelectedIndex="0">
                        <ComboBoxItem>Default</ComboBoxItem>
                        <ComboBoxItem>Vivid</ComboBoxItem>
                    </ComboBox>

                    <Border x:Name="VividPalettePreview" Visibility="Collapsed" Grid.Column="1" Height="36" Margin="9,28,3,0" VerticalAlignment="Top" BorderBrush="Black" BorderThickness="1">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <Rectangle Grid.Column="0" Stroke="Black" StrokeThickness="1" Fill="#c04040" />
                            <Rectangle Grid.Column="1" Stroke="Black" StrokeThickness="1" Fill="#4db34d" />
                            <Rectangle Grid.Column="2" Stroke="Black" StrokeThickness="1" Fill="#4d4db3" />
                            <Rectangle Grid.Column="3" Stroke="Black" StrokeThickness="1" Fill="#d9d91a" />
                        </Grid>
                    </Border>

                    <Border x:Name="DefaultPalettePreview" Grid.Column="1" Height="36" Margin="9,28,3,0" VerticalAlignment="Top" BorderBrush="Black" BorderThickness="1">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <Rectangle Grid.Column="0" Stroke="Black" StrokeThickness="1" Fill="#b38066" />
                            <Rectangle Grid.Column="1" Stroke="Black" StrokeThickness="1" Fill="#cdb366" />
                            <Rectangle Grid.Column="2" Stroke="Black" StrokeThickness="1" Fill="#809a66" />
                            <Rectangle Grid.Column="3" Stroke="Black" StrokeThickness="1" Fill="#8d735a" />
                        </Grid>
                    </Border>
                </Grid>

                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="128" />
                    </Grid.ColumnDefinitions>
                    <ComboBox Grid.Column="0" x:Name="FixedPencilMarksBox" HeaderTemplate="{StaticResource LabelTemplate}" SelectionChanged="FixedPencilMarksBox_SelectionChanged" Header="Pencil mark style" SelectedIndex="0" Margin="0,10,0,0">
                        <ComboBoxItem>Sequential</ComboBoxItem>
                        <ComboBoxItem>Fixed position</ComboBoxItem>
                    </ComboBox>
                    <Border x:Name="SequentialPencilPreview" Grid.Column="1" Background="#ffe6e6e6" BorderBrush="#FF404040" BorderThickness="2" Width="50" Height="50" VerticalAlignment="Top" Margin="0,26,0,0">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF7272E5" FontSize="16">2</TextBlock>
                            <TextBlock Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF7272E5" FontSize="16">3</TextBlock>
                            <TextBlock Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF7272E5" FontSize="16">6</TextBlock>
                            <TextBlock Grid.Row="1"  HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF7272E5" FontSize="16">7</TextBlock>
                        </Grid>
                    </Border>
                    <Border x:Name="FixedPencilPreview" Grid.Column="1" Visibility="Collapsed" Background="#ffe6e6e6" BorderBrush="#FF404040" BorderThickness="2" Width="50" Height="50" VerticalAlignment="Top" Margin="0,26,0,0">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <TextBlock Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF7272E5" FontSize="16">2</TextBlock>
                            <TextBlock Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF7272E5" FontSize="16">3</TextBlock>
                            <TextBlock Grid.Row="1" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF7272E5" FontSize="16">6</TextBlock>
                            <TextBlock Grid.Row="2"  HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF7272E5" FontSize="16">7</TextBlock>
                        </Grid>
                    </Border>
                </Grid>
            </StackPanel>
        </Grid>
    </Grid>
</Page>
